import request from '@/utils/request'
/**
 *
 * 优惠券管理
 *
 **/

// 查询列表数据
export const getVoucherPage = (params: any) => {
  return request({
    url: '/voucher/list',
    method: 'get',
    params,
  })
}

// 删除数据接口
export const deleteVoucher = (id: string) => {
  return request({
    url: `/voucher/${id}`,
    method: 'delete'
  })
}

// 修改数据接口
export const editVoucher = (params: any) => {
  return request({
    url: '/voucher',
    method: 'put',
    data: { ...params }
  })
}

// 新增数据接口
export const addVoucher = (params: any) => {
  return request({
    url: '/voucher',
    method: 'post',
    data: { ...params }
  })
}

// 查询详情接口
export const queryVoucherById = (id: string) => {
  return request({
    url: `/voucher/${id}`,
    method: 'get'
  })
}